<!DOCTYPE html>
<html lang="en">
#parse('base/head.html')
<body class="no-skin">
<div class="indexHeader">
    #parse('base/top_head.html')
    #parse('base/menu.html')
</div>
<div class="main-container ace-save-state" id="main-container">
        <div class="fp-framework main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <div class="row">
                    <div class="col-sm-2" id="left-gov-tree">
                        <div  class="sidebar responsive ace-save-state">
                            <ul class="fp-framework nav nav-list townUl">
                                <li class="townTreeNode" townValue="-1">
                                    <a href="#" class="dropdown-toggle">
                                        <i class="menu-icon fa fa-list"></i>
                                        <span class="menu-text"> 苏尼特右旗</span>
                                    </a>
                                    <b class="arrow"></b>
                                    <ul class="submenu">
                                        <li class="villTreeNode" >
                                        </li>
                                    </ul>
                                </li>
                                #foreach($town in $townInfoPOList)
                                    <li class="townTreeNode" townValue="$town.townId">
                                    <a href="#" class="dropdown-toggle">
                                        <i class="menu-icon fa fa-list"></i>
                                        <span class="menu-text"> $town.townName </span>
                                        <b class="arrow fa fa-angle-down"></b>
                                    </a>
                                    <b class="arrow"></b>
                                    <ul class="submenu">
                                        #foreach($villageInfoPO in $town.villageInfoPOList)
                                        <li class="villTreeNode" villValue="$villageInfoPO.villageId">
                                            <a href="javacript:void(0);">
                                                <i class="menu-icon fa fa-caret-right"></i>
                                               $villageInfoPO.villageName
                                            </a>
                                            <b class="arrow"></b>
                                        </li>
                                        #end
                                    </ul>
                                </li>
                                #end
                            </ul><!-- /.nav-list -->
                        </div>
                    </div>
                    <div class="col-sm-10">
                        <iframe  id="contentFrame" height="600px" onload="setTimeout(function(){setheight()},1000);" frameborder=”no” border=”0″ marginwidth=”0″ marginheight=”0″ scrolling=”no”   style="border:0px;width:100%;"  frameborder="0"  src=""></iframe>
                    </div>
                </div>
            </div><!-- /.page-content -->
        </div>
    </div>
</div>
#parse('base/footer.html')
<script type="text/javascript">
	function setIframeHeight(iframe) {
		if (iframe) {
			var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
			if (iframeWin.document.getElementsByTagName("body")[0]) {
				iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
			}
		}
	};

	function setheight(){
//		setIframeHeight(document.getElementById('contentFrame'));
        var BodyHeight=document.documentElement.clientHeight;
        BodyHeight -= 130;
        $("#contentFrame").css({
            "height" : BodyHeight +"px"
        });
	}
	
	window.onload = function () {
		setIframeHeight(document.getElementById('contentFrame'));
	};
    jQuery(function ($) {
        menuActive(3)
        $(".townTreeNode").on('click',function () {
            var me = this;
            var isOpen = this.classList.contains('open');
            if(isOpen){
                //console.info
                //console.info($("#contentFrame"))
            }else {
                var townId = $(this).attr('townValue');
                $("#contentFrame")[0].src = "$!webPath/qzgl/helpMain?helpState=0&townId=" + townId;
                $(".villTreeNode").removeClass("fp-active");
            }
            
        })
        // 村点击事件
        $(".villTreeNode").on('click',function () {
        	var me = this;
            var villId = $(me).attr('villValue');
            $(".villTreeNode").removeClass("fp-active");
            $(me).addClass('fp-active');
            //console.info('村节点点击')
            console.info( "$!webPath/qzgl/helpMain?helpState=0&villageId=" + villId);
            $("#contentFrame")[0].src = "$!webPath/qzgl/helpMain?helpState=0&villageId=" + villId
        })
        $(".townUl li:eq(0)").addClass('open').addClass('fp-active');
        $(".villTreeNode li:eq(0)").addClass('fp-active');
        var townId = $(".townUl li:eq(0)").attr('townValue')
        //console.info(townId)
        $("#contentFrame")[0].src = "$!webPath/qzgl/helpMain?helpState=0&townId=" + townId
    // 显示项目详情
    })
</script>
</body>
</html>